<template>
    <h2>显示</h2>
    <div>
        <input type="text" v-model="que.yhm">用户名
        <input type="text" v-model="que.xb">性别
        <input type="button" value="查询" @click="xs">


      

        <table>
            <thead>
                <tr>
                    <td>用户名</td>
                    <td>性别</td>
                    <td>地址</td>
                    <td>时长</td>
                    <td>开始时间</td>
                 
                </tr>
            </thead>
            <tbody>
                <tr v-for="m in data">
                    <td>{{m.yhm}}</td>
                    <td>{{m.xb}}</td>
                    <td>{{m.dz}}</td>
                    <td>{{m.sj}}</td>
                    <td>{{m.dqsj}}</td>
                 
                </tr>
            </tbody>
        </table>

    </div>
</template>

<script setup lang="ts">
import axios from 'axios';
import { ref,onMounted } from 'vue';

const data=ref([{
    "id": 0,
  "yhm": "",
  "mm": "",
  "xb": "",
  "dz": "",
  "sj": 0,
  "dqsj": ""
}])

const que=ref({
    "yhm": "",
    "xb": "",
})

onMounted(()=>{
    xs();
})

const xs=()=>{
    axios.get("https://localhost:7234/api/we/xs",{params:que.value}).then(res=>{
       data.value=res.data
    })
}

</script>

<style scoped>

</style>